@extends('layouts.app')
@section('content')
<div class="page-container">
	<div class="cl  bg-1 bk-gray">
        <span class="">&nbsp;&nbsp;<strong>{{$stock}}</strong> ，股票代码：<strong>{{$code}}</strong> ，共有数据：<strong>{{$data->count()}}</strong> 条</span> 
        <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:history.go(-1);" title="刷新" >返回</a>
     </div>
	<div class="mt-20">
	<table class="table table-border table-bordered table-hover table-bg table-sort">
		<thead>
			<tr class="text-c">
				<th width="80">日期</th>
				<th width="100">开盘价</th>
				<th width="40">收盘价</th>
				<th width="90">最高价</th>
				<th width="90">最低价</th>
				<th width="100">交易量/万</th>
				<th width="100">价格变动</th>
				<th width="100">涨跌比</th>
			</tr>
		</thead>
		<tbody>
              @foreach ($data as $val)
        	    <tr class="text-c">
                    <td>{{$val->date}}</td>
                    <td>{{$val->open}}</td>
                    <td>{{$val->close}}</td>
                    <td>{{$val->high}}</td>
                    <td>{{$val->low}}</td>
                    <td>{{round($val->volume/10000)}}</td>
					<td>
                    @if($val->price_change>0)
                        <strong style='color:red;' >{{$val->price_change}}</strong>
                    @else
                        <strong style='color:green;' >{{$val->price_change}}</strong>
                    @endif
                    </td>
                    <td>
                    @if($val->p_change>0)
                        <strong style='color:red;' >{{$val->p_change}}</strong>
                    @else
                        <strong style='color:green;' >{{$val->p_change}}</strong>
                    @endif
                    </td>
                </tr>
             @endforeach
		</tbody>
	</table>
	</div>
</div>

@endsection